/**
 * 
 */
package br.embedded.socialapp.data;

import java.io.IOException;
import java.util.Properties;

/**
 * @author Daniel
 *
 */
public class ConfigurationReader
{
	private static ConfigurationReader singleton;
	public static String DRIVER;
	public static String CONNECTION;
	public static String USER;
	public static String PWD;
	
	private ConfigurationReader()
	{
		read();
	}
	
	public static ConfigurationReader readAllParameters()
	{
		if (singleton == null)
			singleton = new ConfigurationReader();
		return singleton;
	}
	
	private void read()
	{
		Properties properties = new Properties();
		try
		{
			properties.load(this.getClass().getResourceAsStream("mysocial.properties"));
			
			DRIVER = properties.getProperty("DRIVER");
			CONNECTION = properties.getProperty("CONNECTION");
			USER = properties.getProperty("USER");
			PWD = properties.getProperty("PWD");
		}
		catch (IOException e)
		{} 
	}
}
